/** When your routing table is too long, you can split it into small modules **/

import Layout from "@/layout";

const userSettingsRouter = {
  path: "/usersettings",
  component: Layout,
  redirect: "/usersettings/user/list",
  alwaysShow: true, // will always show the root menu
  name: "Research Team",
  meta: {
    title: "用户管理",
    icon: "user",
  },
  children: [
    {
      path: "/profile",
      component: () => import("@/views/user-settings/profile/index"),
      redirect: "/usersettings/profile/edit",
      children: [
        {
          path: "edit",
          component: () => import("@/views/user-settings/profile/Edit"),
          name: "EditProfile",
          meta: {
            title: "个人信息",
            permission: "个人信息：更新",
            noCache: true,
            activeMenu: "/profile/edit",
          }
        },
      ],
    },
    {
      path: "/user",
      component: () => import("@/views/user-settings/user/index"),
      redirect: "/usersettings/user/list",
      children: [
        {
          path: "create",
          component: () => import("@/views/user-settings/user/Create"),
          name: "CreateUser",
          hidden: true,
          meta: { title: "新增用户",
          permission: "用户信息：创建",
        },
        },
        {
          path: "edit/:id(\\d+)",
          component: () => import("@/views/user-settings/user/Edit"),
          name: "EditUser",
          meta: {
            title: "编辑用户信息",
            permission: "用户信息：更新",
            noCache: true,
            activeMenu: "/user/list",
          },
          hidden: true,
        },
        {
          path: "view/:id(\\d+)",
          component: () => import("@/views/user-settings/user/View"),
          name: "ViewUser",
          meta: {
            title: "查看用户信息",
            permission: "用户信息：浏览",
            noCache: true,
            activeMenu: "/user/view",
          },
          hidden: true,
        },
        {
          path: "list",
          component: () => import("@/views/user-settings/user/List"),
          name: "UserList",
          meta: { title: "所有用户",
            permission: "用户信息：浏览",
          },
        },
      ],
    },
    {
      path: "/role",
      component: () => import("@/views/user-settings/role/index"),
      redirect: "/usersettings/role/list",
      children: [
        {
          path: "create",
          component: () => import("@/views/user-settings/role/Create"),
          name: "CreateRole",
          hidden: true,
          meta: { title: "新增角色",
           permission: "角色信息：创建",
          },
        },
        {
          path: "edit/:id(\\d+)",
          component: () => import("@/views/user-settings/role/Edit"),
          name: "EditRole",
          meta: {
            title: "编辑角色信息",
            permission: "角色信息：更新",
            noCache: true,
            activeMenu: "/role/list",
          },
          hidden: true,
        },
        {
          path: "view/:id(\\d+)",
          component: () => import("@/views/user-settings/role/View"),
          name: "ViewRole",
          meta: {
            title: "查看角色信息",
            permission: "角色信息：浏览",
            noCache: true,
            activeMenu: "/role/view",
          },
          hidden: true,
        },
        {
          path: "list",
          component: () => import("@/views/user-settings/role/List"),
          name: "RoleList",
          meta: { title: "所有角色",
            permission: "角色信息：浏览",
          },
        },
      ],
    },
  ],
};

export default userSettingsRouter;
